package gui.typeEditors;

import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

public class ByteEditor extends NumberEditor<Byte> implements ActionListener, FocusListener
{
	private static final long serialVersionUID = 6195335893738468963L;
	
	public ByteEditor(byte initialValue)
	{
		super(initialValue, (byte)1, DEFAULT_COLUMNS, true);
	}
	
	@Override
	public Byte getValue()
	{
		return (byte)value;
	}
	
	@Override
	protected Byte div(Byte value, Byte divisor)
	{
		return (byte) (value/divisor);
	}
	
	@Override
	protected Byte mul(Byte value, Byte factor)
	{
		return (byte) (value*factor);
	}
	
	@Override
	protected Byte parse(String text)
	{
		return Byte.parseByte(text);
	}
	
}
